home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 7 / BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso / Files / Tele / T / The Survey Editor2.0.HC.cpt / The Survey Editor 2.0 / card_4495.txt < prev    next >
Text File  |  1990-01-30  |  13KB  |  512 lines

  1. -- card: 4495 from stack: in.0
  2. -- bmap block id: 5257
  3. -- flags: 0000
  4. -- background id: 2767
  5. -- name: input
  6. ----- HyperTalk script -----
  7. on openCard
  8.   menuHandler "hide","editor",0
  9.   menuHandler "hide","Commands",0
  10.   put "" into cd field "name"
  11.   put "" into cd field "branch"
  12.   put "" into cd field "input"
  13.   put "" into cd field "comment"
  14.   put 0 into cd field "length"
  15.   show cd btn "ok"
  16. end openCard
  17.  
  18. on closeCard
  19.   menuHandler "hide","Insert Control..."
  20.   menuHandler "show","editor",0
  21.   menuHandler "show","Commands",0
  22.   show cd btn "cancel"
  23.   show cd btn "ok"
  24. end closeCard
  25.  
  26. on domenu which
  27.   if which is in "Bell,Tab,Clear Screen,Backspace,(-,Other..." then
  28.     if which is "Bell" then put NumToChar(7) after cd field "input"
  29.     if which is "Tab" then put NumToChar(10) after cd field "input"
  30.     if which is "Clear Screen" then put NumToChar(12) after cd field "input"
  31.     if which is "Backspace" then put NumToChar(8) after cd field "input"
  32.     if which is "other..." then
  33.       ask "Value of the ASCII character to insert?"
  34.       if it is empty then exit domenu
  35.       repeat with x = 1 to the number of chars in it
  36.         if charToNum(char x of it) < 48 or charToNum(char x of it) > 57 then
  37.           answer "Sorry, numbers only!"
  38.           exit domenu
  39.         end if
  40.       end repeat
  41.       put NumToChar(it) after cd field "input"
  42.     end if
  43.   else
  44.     pass domenu
  45.   end if
  46. end domenu
  47.  
  48. -- initiate nameFlag,nameLabel,lengthFlag,lengthLabel,branchFlag, -- branchLable,inputFlag,inputLabel,CRflag,SFGetFlag,commandNumber,
  49. -- displayString (verbose of the commandNumber)
  50. on initiate nameFlag,NameLabel,lengthFlag,LengthLabel,branchFlag, branchLabel,inputFlag,InputLabel,CRflag,SFGetFlag,commandNumber, displayString
  51.   if nameFlag is false then
  52.     hide cd field "name Label"
  53.     hide cd field "name"
  54.   else
  55.     put nameLabel into cd field "name label"
  56.     show cd field "name Label"
  57.     show cd field "name"
  58.   end if
  59.   if lengthFlag is false then
  60.     hide cd field "Length Label"
  61.     hide cd field "Length"
  62.   else
  63.     put LengthLabel into cd field "Length label"
  64.     show cd field "Length Label"
  65.     show cd field "Length"
  66.   end if
  67.   if branchFlag is false then
  68.     hide cd field "Branch Label"
  69.     hide cd field "branch"
  70.   else
  71.     put branchlabel into cd field "branch label"
  72.     show cd field "branch Label"
  73.     show cd field "branch"
  74.   end if
  75.   if inputFlag is false then
  76.     hide cd field "input Label"
  77.     hide cd field "input"
  78.   else
  79.     put inputlabel into cd field "input label"
  80.     show cd field "input Label"
  81.     show cd field "input"
  82.   end if
  83.   if CRflag is true then show cd btn id 2 --Terminate with a CR
  84.   else hide cd btn id 2
  85.   if SFGetFlag is true then show cd btn id 3 -- get path name
  86.   else hide cd btn id 3
  87.   put commandNumber into cd field "command"
  88.   put displayString into cd field "display"
  89.   unlock screen with barn door open
  90.   if the visible of cd field "input" is true
  91.   then menuHandler "show","Insert Control..."
  92.   put offset("‚Ä¢",cd field "display") into rsx
  93.   if rsx ‚↠0 then
  94.     delete char rsx to (number of chars in cd field "display") of cd field "display"
  95.   end if
  96.   if commandNumber > 21 and commandNumber < 26 then
  97.     show cd btn "flag number"
  98.     put "x." into last word of cd field "display"
  99.   else
  100.     hide cd btn "flag number"
  101.   end if
  102. end initiate
  103.  
  104. on idle
  105.   if the visible of cd field "input" is false then exit idle
  106.   if number of chars in cd field "input" > 79 then
  107.     if the visible of cd btn "ok" is false then exit idle
  108.     answer "Sorry! Cannot accept more than 79 characters."
  109.     hide cd btn "ok"
  110.   else
  111.     show cd btn "ok"
  112.   end if
  113. end idle
  114.  
  115. on returnKey
  116.   if the visible of cd btn "ok" is true
  117.   then click at the loc of cd btn "ok"
  118. end returnKey
  119.  
  120. on arrowKey
  121. end arrowKey
  122.  
  123.  
  124.  
  125. -- part 1 (button)
  126. -- low flags: 00
  127. -- high flags: C002
  128. -- rect: left=0 top=0 right=20 bottom=512
  129. -- title width / last selected line: 0
  130. -- icon id / first selected line: 0 / 0
  131. -- text alignment: 1
  132. -- font id: 0
  133. -- text size: 12
  134. -- style flags: 0
  135. -- line height: 16
  136. -- part name: The Survey Editor 2.0    (c) 1990 Pierrot Vachon
  137.  
  138.  
  139. -- part 3 (button)
  140. -- low flags: 00
  141. -- high flags: A003
  142. -- rect: left=410 top=229 right=249 bottom=492
  143. -- title width / last selected line: 0
  144. -- icon id / first selected line: 0 / 0
  145. -- text alignment: 1
  146. -- font id: 0
  147. -- text size: 12
  148. -- style flags: 0
  149. -- line height: 16
  150. -- part name: Get path...
  151. ----- HyperTalk script -----
  152. on mouseUp
  153.   put "" into theType
  154.   put cd field "command" into commandNumber
  155.   if commandNumber = 18 then put "MENU" into theType
  156.   if commandNumber = 26 or commandNumber = 27 or commandNumber = 28 or commandNumber = 29 then put "TEXT" into theType
  157.  
  158.   put FileName(theType,"Please select a file...") into fichier
  159.   if fichier ‚↠"" then
  160.     if the visible of cd field "input" is true
  161.     then put fichier into cd field "input"
  162.   else put fichier into cd field "branch"
  163. end if
  164. end mouseUp
  165.  
  166.  
  167.  
  168. -- part 4 (field)
  169. -- low flags: 01
  170. -- high flags: 0000
  171. -- rect: left=20 top=58 right=92 bottom=492
  172. -- title width / last selected line: 0
  173. -- icon id / first selected line: 0 / 0
  174. -- text alignment: 0
  175. -- font id: 4
  176. -- text size: 12
  177. -- style flags: 0
  178. -- line height: 16
  179. -- part name: display
  180.  
  181.  
  182. -- part 5 (field)
  183. -- low flags: 02
  184. -- high flags: 0002
  185. -- rect: left=20 top=250 right=288 bottom=492
  186. -- title width / last selected line: 0
  187. -- icon id / first selected line: 0 / 0
  188. -- text alignment: 0
  189. -- font id: 4
  190. -- text size: 12
  191. -- style flags: 16384
  192. -- line height: 18
  193. -- part name: input
  194. ----- HyperTalk script -----
  195. on returnInField
  196.   if checkASCII(target) is true then
  197.     answer "Sorry, this field contains a non ASCII character."
  198.     exit returnInField
  199.   end if
  200.   click at the loc of cd btn "ok"
  201. end returnInField
  202.  
  203. on enterInField
  204.   returnInField
  205. end enterInField
  206.  
  207.  
  208. -- part 6 (field)
  209. -- low flags: 01
  210. -- high flags: 0000
  211. -- rect: left=17 top=230 right=247 bottom=409
  212. -- title width / last selected line: 0
  213. -- icon id / first selected line: 0 / 0
  214. -- text alignment: 0
  215. -- font id: 4
  216. -- text size: 12
  217. -- style flags: 0
  218. -- line height: 16
  219. -- part name: input label
  220. ----- HyperTalk script -----
  221. on returnInField
  222.   click at the loc of cd btn "ok"
  223. end returnInField
  224.  
  225.  
  226. -- part 7 (button)
  227. -- low flags: 00
  228. -- high flags: A003
  229. -- rect: left=158 top=302 right=327 bottom=233
  230. -- title width / last selected line: 0
  231. -- icon id / first selected line: 0 / 0
  232. -- text alignment: 1
  233. -- font id: 0
  234. -- text size: 12
  235. -- style flags: 0
  236. -- line height: 16
  237. -- part name: Cancel
  238. ----- HyperTalk script -----
  239. on mouseUp
  240.   go cd 1
  241. end mouseUp
  242.  
  243.  
  244.  
  245. -- part 8 (button)
  246. -- low flags: 00
  247. -- high flags: A003
  248. -- rect: left=279 top=302 right=327 bottom=354
  249. -- title width / last selected line: 0
  250. -- icon id / first selected line: 0 / 0
  251. -- text alignment: 1
  252. -- font id: 0
  253. -- text size: 12
  254. -- style flags: 0
  255. -- line height: 16
  256. -- part name: OK
  257. ----- HyperTalk script -----
  258. on mouseUp
  259.   ok true
  260. end mouseUp
  261.  
  262. on ok
  263.   put "name,comment,branch,input,length" into fieldLIST
  264.   repeat with y = 1 to 5
  265.     repeat while offset(return,cd field item y of fieldLIST) ‚↠0
  266.       put "" into char offset(return,cd field item y of fieldLIST) of cd field item y of fieldLIST
  267.     end repeat
  268.   end repeat
  269.  
  270.   put upper(cd field "name") into label
  271.   put upper(cd field "branch") into branch
  272.   put cd field "input" into text
  273.   put cd field "length" into length
  274.   put cd field "comment" into comment
  275.   if length = "" then put 0 into length
  276.  
  277.   put cd field "command" into commande
  278.   if commande = 1 then
  279.     if the hilite of cd btn id 2 is true then -- end with a return
  280.       put 0 into length
  281.     else
  282.       put 1 into length
  283.     end if
  284.   end if
  285.   go cd 1
  286.   put compute(label,commande,text,length,branch) into displayString
  287.   if the hilite of cd btn "label above command" is true then
  288.     put offset("‚Ä¢",displayString) into Xstart
  289.     put the number of chars in displayString into Xend
  290.     put char Xstart to Xend of displayString & return into temp
  291.     delete char Xstart to Xend of displayString
  292.     put temp before displayString
  293.   end if
  294.  
  295.   put comment & return & label & return & commande & return & text & return & length & return & branch into command
  296.  
  297.   WRTstrg command,displayString, line 1 of cd field "action",line 2 of cd field "action"
  298. end ok
  299.  
  300. on cancel
  301.   ok false
  302. end cancel
  303.  
  304.  
  305.  
  306.  
  307. -- part 9 (field)
  308. -- low flags: 01
  309. -- high flags: 0000
  310. -- rect: left=93 top=113 right=135 bottom=122
  311. -- title width / last selected line: 0
  312. -- icon id / first selected line: 0 / 0
  313. -- text alignment: 1
  314. -- font id: 3
  315. -- text size: 12
  316. -- style flags: 0
  317. -- line height: 18
  318. -- part name: command
  319.  
  320.  
  321. -- part 10 (field)
  322. -- low flags: 01
  323. -- high flags: 0000
  324. -- rect: left=190 top=113 right=135 bottom=325
  325. -- title width / last selected line: 0
  326. -- icon id / first selected line: 0 / 0
  327. -- text alignment: 65535
  328. -- font id: 4
  329. -- text size: 12
  330. -- style flags: 0
  331. -- line height: 18
  332. -- part name: name label
  333.  
  334.  
  335. -- part 11 (field)
  336. -- low flags: 00
  337. -- high flags: 0002
  338. -- rect: left=324 top=113 right=135 bottom=492
  339. -- title width / last selected line: 0
  340. -- icon id / first selected line: 0 / 0
  341. -- text alignment: 0
  342. -- font id: 4
  343. -- text size: 12
  344. -- style flags: 0
  345. -- line height: 18
  346. -- part name: name
  347. ----- HyperTalk script -----
  348. on returnInField
  349.   if checkASCII(target) is true then
  350.     answer "Sorry, this field contains a non ASCII character."
  351.     exit returnInField
  352.   end if
  353.   click at the loc of cd btn "ok"
  354. end returnInField
  355.  
  356. on enterInField
  357.   returnInField
  358. end enterInField
  359.  
  360.  
  361. -- part 12 (field)
  362. -- low flags: 81
  363. -- high flags: 0000
  364. -- rect: left=20 top=194 right=216 bottom=140
  365. -- title width / last selected line: 0
  366. -- icon id / first selected line: 0 / 0
  367. -- text alignment: 65535
  368. -- font id: 4
  369. -- text size: 12
  370. -- style flags: 0
  371. -- line height: 18
  372. -- part name: length label
  373.  
  374.  
  375. -- part 2 (button)
  376. -- low flags: 80
  377. -- high flags: E005
  378. -- rect: left=256 top=232 right=249 bottom=494
  379. -- title width / last selected line: 0
  380. -- icon id / first selected line: 0 / 0
  381. -- text alignment: 1
  382. -- font id: 0
  383. -- text size: 12
  384. -- style flags: 0
  385. -- line height: 16
  386. -- part name: Terminate with a carriage return
  387.  
  388.  
  389. -- part 13 (field)
  390. -- low flags: 80
  391. -- high flags: 0002
  392. -- rect: left=138 top=194 right=216 bottom=168
  393. -- title width / last selected line: 0
  394. -- icon id / first selected line: 0 / 0
  395. -- text alignment: 0
  396. -- font id: 4
  397. -- text size: 12
  398. -- style flags: 0
  399. -- line height: 18
  400. -- part name: length
  401. ----- HyperTalk script -----
  402. on returnInField
  403.   click at the loc of cd field "input"
  404. end returnInField
  405.  
  406.  
  407. -- part 14 (field)
  408. -- low flags: 81
  409. -- high flags: 0000
  410. -- rect: left=193 top=194 right=216 bottom=324
  411. -- title width / last selected line: 0
  412. -- icon id / first selected line: 0 / 0
  413. -- text alignment: 65535
  414. -- font id: 4
  415. -- text size: 12
  416. -- style flags: 0
  417. -- line height: 18
  418. -- part name: branch label
  419.  
  420.  
  421. -- part 15 (field)
  422. -- low flags: 80
  423. -- high flags: 0002
  424. -- rect: left=323 top=194 right=216 bottom=492
  425. -- title width / last selected line: 0
  426. -- icon id / first selected line: 0 / 0
  427. -- text alignment: 0
  428. -- font id: 4
  429. -- text size: 12
  430. -- style flags: 0
  431. -- line height: 18
  432. -- part name: branch
  433. ----- HyperTalk script -----
  434. on returnInField
  435.   click at the loc of cd btn "ok"
  436. end returnInField
  437.  
  438.  
  439. -- part 16 (field)
  440. -- low flags: 00
  441. -- high flags: 0002
  442. -- rect: left=20 top=159 right=181 bottom=492
  443. -- title width / last selected line: 0
  444. -- icon id / first selected line: 0 / 0
  445. -- text alignment: 0
  446. -- font id: 4
  447. -- text size: 12
  448. -- style flags: 0
  449. -- line height: 18
  450. -- part name: comment
  451. ----- HyperTalk script -----
  452. on returnInField
  453. end returnInField
  454.  
  455.  
  456. -- part 19 (button)
  457. -- low flags: 80
  458. -- high flags: 8004
  459. -- rect: left=142 top=230 right=249 bottom=247
  460. -- title width / last selected line: 0
  461. -- icon id / first selected line: 0 / 0
  462. -- text alignment: 1
  463. -- font id: 0
  464. -- text size: 12
  465. -- style flags: 0
  466. -- line height: 16
  467. -- part name: Flag Number
  468. ----- HyperTalk script -----
  469. on mouseDown
  470.  
  471.   set the hilite of me to true
  472.   set cursor to arrow
  473.   put "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24" into flagMENU
  474.  
  475.   put PopUpMenu (flagMENU,"",item 3 of the rect of me, item 4 of the rect of me-220) into theITEM
  476.  
  477.   set the hilite of me to false
  478.  
  479.   if theITEM = 0 then exit mouseDown
  480.  
  481.   put item theITEM of flagMENU into cd field "input"
  482. end mouseDown
  483.  
  484.  
  485.  
  486. -- part contents for card part 10
  487. ----- text -----
  488. Label:
  489.  
  490. -- part contents for card part 12
  491. ----- text -----
  492. Length:
  493.  
  494. -- part contents for card part 6
  495. ----- text -----
  496. Text file to display:
  497.  
  498. -- part contents for card part 9
  499. ----- text -----
  500. 28
  501.  
  502. -- part contents for card part 14
  503. ----- text -----
  504. Branch to:
  505.  
  506. -- part contents for card part 13
  507. ----- text -----
  508. 0
  509.  
  510. -- part contents for card part 4
  511. ----- text -----
  512. Display TEXT file. Not cancellable, all prompts...